package rms.mall.server.starter.controller.system;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import rms.mall.server.api.module.Result;
import rms.mall.server.api.module.system.LoginReq;
import rms.mall.server.application.service.LoginService;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/v1/system/login")
public class LoginController {


    @Resource
    private LoginService loginService;


    @PostMapping("/password")
    public Result loginByPassword(@RequestBody LoginReq loginReq) {
        String token = loginService.loginByPassword(loginReq);
        return Result.OK(token);
    }


}
